package com.techsoul.module.accounting.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.module.accounting.pojo.param.MaterialBuyPriceSaveParam;
import com.techsoul.module.accounting.pojo.param.MaterialBuyPriceSearchParam;
import com.techsoul.module.accounting.pojo.vo.MaterialBuyPriceVo;
import com.techsoul.module.basic.pojo.vo.StoreVo;
import com.techsoul.module.goods.pojo.entity.Spu;
import com.techsoul.module.goods.pojo.vo.MaterialImportVo;
import com.techsoul.module.pms.pojo.entity.GoodsGroup;
import com.techsoul.module.pms.pojo.entity.GoodsSupplier;
import com.techsoul.module.goods.pojo.entity.Sku;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * 供应商采购价格配置基础，用于配置价格，产生最后付款结算。 Service接口
 * 
 * @author liuen
 * @date 2021-04-11
 */
public interface IMaterialBuyPriceService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(MaterialBuyPriceSaveParam params);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(MaterialBuyPriceSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    MaterialBuyPriceVo findById(String id);

    /**
     * 列表
     * @param params
     * @return
     */
    List<MaterialBuyPriceVo> findAll(MaterialBuyPriceSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<MaterialBuyPriceVo> findAll(MaterialBuyPriceSearchParam params, Integer current, Integer pageSize);

    /**
     * 列表
     * @param params
     * @return
     */
    List<MaterialBuyPriceVo> findAllList(MaterialBuyPriceSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<MaterialBuyPriceVo> findAllList(MaterialBuyPriceSearchParam params, Integer current, Integer pageSize);

    /**
     * 导入模板
     */
    String importTemplate();

    /**
     * 导入
     * @param file
     * @return
     */
    String importData(String storeId, Date applyDate, MultipartFile file);

    List<MaterialBuyPriceVo> getByMapId(String id);
    /**
     * 生成商品
     * @param materialBuyPriceVo
     * @return
     */
    Spu generateNewSpu(MaterialBuyPriceVo materialBuyPriceVo, StoreVo storeVo,String custGoodNo);

    GoodsSupplier generateNewGoodsSupplier(MaterialBuyPriceVo materialBuyPriceVo,String supplierNo,String supplierName,String spuid,String storeId,String storeName);

     GoodsGroup generateNewGoodsGroup(MaterialBuyPriceVo materialBuyPriceVo);
    /**
     * 生成商品SKU
     * @param materialBuyPriceVo
     * @return
     */
    Sku generateNewSku(MaterialBuyPriceVo materialBuyPriceVo,Spu spu);

    /**
     * 导入历史数据模板
     */

     String importExistSpuTemplate();
     String removeSpecialChar(String input);
     MaterialImportVo removeSpecialChar(MaterialImportVo input);

    MaterialBuyPriceVo removeSpecialCharMaterialBuyPriceVo(MaterialBuyPriceVo input);
    /**
     * 导入历史数据
     * @param file
     * @return
     */
    String importExistSpuData(String mallId,MultipartFile file);

    /**
     * 生成商品
     * @param materialImportVo
     * @return
     */
    Spu generateNewSpu(MaterialImportVo materialImportVo,StoreVo storeVo,String custGoodNo);

    GoodsSupplier generateNewGoodsSupplier(MaterialImportVo materialImportVo,String supplierNo,String supplierName,String spuid);

    GoodsGroup generateNewGoodsGroup(MaterialImportVo materialImportVo);
    /**
     * 生成商品SKU
     * @param materialImportVo
     * @param spu
     * @return
     */
    Sku generateNewSku(MaterialImportVo materialImportVo,Spu spu);
}
